<!doctype html>
<script src="../../../resources/testharness.js"></script>
<script src="../../../resources/testharnessreport.js"></script>
<script src="../../assert_selection.js"></script>
<script>
selection_test(
  '<div contenteditable dir="ltr">|Lorem <span style="direction: ltr">ipsum dolor sit</span> amet</div>',
  selection => selection.modify('extend', 'forward', 'lineboundary'),
  '<div contenteditable dir="ltr">^Lorem <span style="direction: ltr">ipsum dolor sit</span> amet|</div>',
  '6-0 ltr forward lineboundary');

selection_test(
  '<div contenteditable dir="ltr">L|orem <span style="direction: ltr">ipsum dolor sit</span> amet</div>',
  selection => selection.modify('extend', 'forward', 'lineboundary'),
  '<div contenteditable dir="ltr">L^orem <span style="direction: ltr">ipsum dolor sit</span> amet|</div>',
  '6-1 ltr forward lineboundary');

selection_test(
  '<div contenteditable dir="ltr">Lo|rem <span style="direction: ltr">ipsum dolor sit</span> amet</div>',
  selection => selection.modify('extend', 'forward', 'lineboundary'),
  '<div contenteditable dir="ltr">Lo^rem <span style="direction: ltr">ipsum dolor sit</span> amet|</div>',
  '6-2 ltr forward lineboundary');

selection_test(
  '<div contenteditable dir="ltr">Lor|em <span style="direction: ltr">ipsum dolor sit</span> amet</div>',
  selection => selection.modify('extend', 'forward', 'lineboundary'),
  '<div contenteditable dir="ltr">Lor^em <span style="direction: ltr">ipsum dolor sit</span> amet|</div>',
  '6-3 ltr forward lineboundary');

selection_test(
  '<div contenteditable dir="ltr">Lore|m <span style="direction: ltr">ipsum dolor sit</span> amet</div>',
  selection => selection.modify('extend', 'forward', 'lineboundary'),
  '<div contenteditable dir="ltr">Lore^m <span style="direction: ltr">ipsum dolor sit</span> amet|</div>',
  '6-4 ltr forward lineboundary');

selection_test(
  '<div contenteditable dir="ltr">Lorem| <span style="direction: ltr">ipsum dolor sit</span> amet</div>',
  selection => selection.modify('extend', 'forward', 'lineboundary'),
  '<div contenteditable dir="ltr">Lorem^ <span style="direction: ltr">ipsum dolor sit</span> amet|</div>',
  '6-5 ltr forward lineboundary');

selection_test(
  '<div contenteditable dir="ltr">Lorem <span style="direction: ltr">|ipsum dolor sit</span> amet</div>',
  selection => selection.modify('extend', 'forward', 'lineboundary'),
  '<div contenteditable dir="ltr">Lorem <span style="direction: ltr">^ipsum dolor sit</span> amet|</div>',
  '6-6 ltr forward lineboundary');

selection_test(
  '<div contenteditable dir="ltr">Lorem <span style="direction: ltr">i|psum dolor sit</span> amet</div>',
  selection => selection.modify('extend', 'forward', 'lineboundary'),
  '<div contenteditable dir="ltr">Lorem <span style="direction: ltr">i^psum dolor sit</span> amet|</div>',
  '6-7 ltr forward lineboundary');

selection_test(
  '<div contenteditable dir="ltr">Lorem <span style="direction: ltr">ip|sum dolor sit</span> amet</div>',
  selection => selection.modify('extend', 'forward', 'lineboundary'),
  '<div contenteditable dir="ltr">Lorem <span style="direction: ltr">ip^sum dolor sit</span> amet|</div>',
  '6-8 ltr forward lineboundary');

selection_test(
  '<div contenteditable dir="ltr">Lorem <span style="direction: ltr">ips|um dolor sit</span> amet</div>',
  selection => selection.modify('extend', 'forward', 'lineboundary'),
  '<div contenteditable dir="ltr">Lorem <span style="direction: ltr">ips^um dolor sit</span> amet|</div>',
  '6-9 ltr forward lineboundary');

selection_test(
  '<div contenteditable dir="ltr">Lorem <span style="direction: ltr">ipsu|m dolor sit</span> amet</div>',
  selection => selection.modify('extend', 'forward', 'lineboundary'),
  '<div contenteditable dir="ltr">Lorem <span style="direction: ltr">ipsu^m dolor sit</span> amet|</div>',
  '6-10 ltr forward lineboundary');

selection_test(
  '<div contenteditable dir="ltr">Lorem <span style="direction: ltr">ipsum| dolor sit</span> amet</div>',
  selection => selection.modify('extend', 'forward', 'lineboundary'),
  '<div contenteditable dir="ltr">Lorem <span style="direction: ltr">ipsum^ dolor sit</span> amet|</div>',
  '6-11 ltr forward lineboundary');

selection_test(
  '<div contenteditable dir="ltr">Lorem <span style="direction: ltr">ipsum |dolor sit</span> amet</div>',
  selection => selection.modify('extend', 'forward', 'lineboundary'),
  '<div contenteditable dir="ltr">Lorem <span style="direction: ltr">ipsum ^dolor sit</span> amet|</div>',
  '6-12 ltr forward lineboundary');

selection_test(
  '<div contenteditable dir="ltr">Lorem <span style="direction: ltr">ipsum d|olor sit</span> amet</div>',
  selection => selection.modify('extend', 'forward', 'lineboundary'),
  '<div contenteditable dir="ltr">Lorem <span style="direction: ltr">ipsum d^olor sit</span> amet|</div>',
  '6-13 ltr forward lineboundary');

selection_test(
  '<div contenteditable dir="ltr">Lorem <span style="direction: ltr">ipsum do|lor sit</span> amet</div>',
  selection => selection.modify('extend', 'forward', 'lineboundary'),
  '<div contenteditable dir="ltr">Lorem <span style="direction: ltr">ipsum do^lor sit</span> amet|</div>',
  '6-14 ltr forward lineboundary');

selection_test(
  '<div contenteditable dir="ltr">Lorem <span style="direction: ltr">ipsum dol|or sit</span> amet</div>',
  selection => selection.modify('extend', 'forward', 'lineboundary'),
  '<div contenteditable dir="ltr">Lorem <span style="direction: ltr">ipsum dol^or sit</span> amet|</div>',
  '6-15 ltr forward lineboundary');

selection_test(
  '<div contenteditable dir="ltr">Lorem <span style="direction: ltr">ipsum dolo|r sit</span> amet</div>',
  selection => selection.modify('extend', 'forward', 'lineboundary'),
  '<div contenteditable dir="ltr">Lorem <span style="direction: ltr">ipsum dolo^r sit</span> amet|</div>',
  '6-16 ltr forward lineboundary');

selection_test(
  '<div contenteditable dir="ltr">Lorem <span style="direction: ltr">ipsum dolor| sit</span> amet</div>',
  selection => selection.modify('extend', 'forward', 'lineboundary'),
  '<div contenteditable dir="ltr">Lorem <span style="direction: ltr">ipsum dolor^ sit</span> amet|</div>',
  '6-17 ltr forward lineboundary');

selection_test(
  '<div contenteditable dir="ltr">Lorem <span style="direction: ltr">ipsum dolor |sit</span> amet</div>',
  selection => selection.modify('extend', 'forward', 'lineboundary'),
  '<div contenteditable dir="ltr">Lorem <span style="direction: ltr">ipsum dolor ^sit</span> amet|</div>',
  '6-18 ltr forward lineboundary');

selection_test(
  '<div contenteditable dir="ltr">Lorem <span style="direction: ltr">ipsum dolor s|it</span> amet</div>',
  selection => selection.modify('extend', 'forward', 'lineboundary'),
  '<div contenteditable dir="ltr">Lorem <span style="direction: ltr">ipsum dolor s^it</span> amet|</div>',
  '6-19 ltr forward lineboundary');

selection_test(
  '<div contenteditable dir="ltr">Lorem <span style="direction: ltr">ipsum dolor si|t</span> amet</div>',
  selection => selection.modify('extend', 'forward', 'lineboundary'),
  '<div contenteditable dir="ltr">Lorem <span style="direction: ltr">ipsum dolor si^t</span> amet|</div>',
  '6-20 ltr forward lineboundary');

selection_test(
  '<div contenteditable dir="ltr">Lorem <span style="direction: ltr">ipsum dolor sit</span>| amet</div>',
  selection => selection.modify('extend', 'forward', 'lineboundary'),
  '<div contenteditable dir="ltr">Lorem <span style="direction: ltr">ipsum dolor sit</span>^ amet|</div>',
  '6-21 ltr forward lineboundary');

selection_test(
  '<div contenteditable dir="ltr">Lorem <span style="direction: ltr">ipsum dolor sit</span> |amet</div>',
  selection => selection.modify('extend', 'forward', 'lineboundary'),
  '<div contenteditable dir="ltr">Lorem <span style="direction: ltr">ipsum dolor sit</span> ^amet|</div>',
  '6-22 ltr forward lineboundary');

selection_test(
  '<div contenteditable dir="ltr">Lorem <span style="direction: ltr">ipsum dolor sit</span> a|met</div>',
  selection => selection.modify('extend', 'forward', 'lineboundary'),
  '<div contenteditable dir="ltr">Lorem <span style="direction: ltr">ipsum dolor sit</span> a^met|</div>',
  '6-23 ltr forward lineboundary');

selection_test(
  '<div contenteditable dir="ltr">Lorem <span style="direction: ltr">ipsum dolor sit</span> am|et</div>',
  selection => selection.modify('extend', 'forward', 'lineboundary'),
  '<div contenteditable dir="ltr">Lorem <span style="direction: ltr">ipsum dolor sit</span> am^et|</div>',
  '6-24 ltr forward lineboundary');

selection_test(
  '<div contenteditable dir="ltr">Lorem <span style="direction: ltr">ipsum dolor sit</span> ame|t</div>',
  selection => selection.modify('extend', 'forward', 'lineboundary'),
  '<div contenteditable dir="ltr">Lorem <span style="direction: ltr">ipsum dolor sit</span> ame^t|</div>',
  '6-25 ltr forward lineboundary');

selection_test(
  '<div contenteditable dir="ltr">Lorem <span style="direction: ltr">ipsum dolor sit</span> amet|</div>',
  selection => selection.modify('extend', 'forward', 'lineboundary'),
  '<div contenteditable dir="ltr">Lorem <span style="direction: ltr">ipsum dolor sit</span> amet|</div>',
  '6-26 ltr forward lineboundary');
</script>
